package com.jufanshare.myblog.common.mvc;

import com.jufanshare.myblog.service.request.RequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @功能：
 * @开发者： 大BUG
 * @编写时间： 2019/1/28 11:10
 */
public class RequestHandlerInterceptor implements HandlerInterceptor {
    @Autowired
    private RequestService requestService;
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        // TODO Auto-generated method stub
        requestService.asyncInsert(request);//添加访问记录数据
        return true;
    }
}
